//Monday, October 26 2009
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class StandInLine
{
	public:
		vector <int> reconstruct(vector <int> left)
		{
			vector<int> ret;
			int n = left.size();
			ret.push_back(n);
			for(int i=n-2; i>=0; i--)
			{
				ret.insert(ret.begin() + left[i], i+1);
			}
			return ret;
		}
};
